<template>
<div>
    <el-form
    :model="form"
    :rules="rules"
    ref="form"
    label-width="100px"
    class="demo-form"
  >
    <p align="left" style="color: black; font-size: 20px">基本信息</p>
    <fieldset>
      <p align="left" style="color: red; font-size: 18px">提示:黄色文本框为必填项</p>
      <el-row>
        <el-col :span="10">
          <el-form-item label="编号" prop="customer_number">
            <el-input v-model="form.customer_number" WarningColor='warning'></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="客户简称">
            <el-input v-model="form.customer_for_short"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="10">
          <el-form-item label="客户名称" prop="customer_client_name">
            <el-input v-model="form.customer_client_name" WarningColor='warning'></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="公司地址" prop="customer_company_address">
            <el-input
              v-model="form.customer_company_address"
               WarningColor='warning'
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="10">
          <el-form-item label="邮政编码">
            <el-input v-model="form.customer_postal_code"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="联系人">
            <el-input v-model="form.customer_linkman"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="10">
          <el-form-item label="公司电话">
            <el-input v-model="form.customer_company_tel"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="传真号">
            <el-input v-model="form.customer_fax_number"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </fieldset>

    <p align="left" style="color: black; font-size: 20px">甲方负责人</p>
    <el-button @click="showj">添加</el-button>
    <fieldset>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column
          prop="first_party_number"
          label="序号"
          width="180"
        ></el-table-column>
        <el-table-column
          prop="first_party_name"
          label="姓名"
          width="180"
        ></el-table-column>
        <el-table-column prop="first_party_duty" label="职务">
        </el-table-column>
        <el-table-column prop="first_party_department" label="部门">
        </el-table-column>
        <el-table-column prop="first_party_tell" label="电话">
        </el-table-column>
        <el-table-column prop="first_party_email" label="Email">
        </el-table-column>
        <el-table-column prop="first_party_remark" label="备注">
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button @click="FanFirst(scope.row.first_party_id)"
              >查看</el-button
            >
            <el-button @click="FanFirst(scope.row.first_party_id)"
              >编辑</el-button
            >
            <el-button @click="DeleFirst(scope.row.first_party_id)"
              >删除</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </fieldset>

     <el-dialog title="添加甲方负责人" :visible.sync="dialogVisible" width="30%">
      <span slot="footer" class="dialog-footer">
        <el-form ref="FirstPartyPo" :model="FirstPartyPo" :rules="rules" label-width="80px">
          <el-row>
            <el-col :span="10">
              <el-form-item label="序号" prop="first_party_number">
                <el-input v-model="FirstPartyPo.first_party_number" WarningColor='warning'></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="姓名" prop="first_party_name">
                <el-input v-model="FirstPartyPo.first_party_name" WarningColor='warning'></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="职务">
                <el-input v-model="FirstPartyPo.first_party_duty"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="电话" prop="first_party_tell">
                <el-input v-model="FirstPartyPo.first_party_tell"  WarningColor='warning'></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="部门">
                <el-input
                  v-model="FirstPartyPo.first_party_department"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="商务电话">
                <el-input
                  v-model="FirstPartyPo.first_party_business_calls"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="住宅电话">
                <el-input
                  v-model="FirstPartyPo.first_party_homephone"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="商务传真">
                <el-input
                  v-model="FirstPartyPo.first_party_business_fax"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="住宅传真">
                <el-input v-model="FirstPartyPo.first_party_homefax"></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="Emial">
                <el-input v-model="FirstPartyPo.first_party_email"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="备注">
                <el-input v-model="FirstPartyPo.first_party_remark"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-button @click="dialogVisible = false">取 消</el-button>
          <el-button type="primary" @click="FirstPartyPoAdd('FirstPartyPo')">确 定</el-button>
        </el-form>
      </span>
    </el-dialog>

     <el-dialog title="甲方信息查看" :visible.sync="FirstCha" width="30%">
      <span slot="footer" class="dialog-footer">
        <el-form label-width="80px">
          <el-row>
            <el-col :span="10">
              <el-form-item label="序号">
                <el-input v-model="FanFirstInfo.first_party_number"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="姓名">
                <el-input v-model="FanFirstInfo.first_party_name"></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="职务">
                <el-input v-model="FanFirstInfo.first_party_duty"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="电话">
                <el-input v-model="FanFirstInfo.first_party_tell"></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="部门">
                <el-input
                  v-model="FanFirstInfo.first_party_department"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="商务电话">
                <el-input
                  v-model="FanFirstInfo.first_party_business_calls"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="住宅电话">
                <el-input
                  v-model="FanFirstInfo.first_party_homephone"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="商务传真">
                <el-input
                  v-model="FanFirstInfo.first_party_business_fax"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="住宅传真">
                <el-input v-model="FanFirstInfo.first_party_homefax"></el-input>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row>
            <el-col :span="10">
              <el-form-item label="Emial">
                <el-input v-model="FanFirstInfo.first_party_email"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="10">
              <el-form-item label="备注">
                <el-input v-model="FanFirstInfo.first_party_remark"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-button @click="UpdateFirst">修改</el-button>
          </el-row>
        </el-form>
      </span>
    </el-dialog>

    <p align="left" style="color: black; font-size: 20px">扩展信息</p>
    <fieldset>
      <el-row>
        <el-col :span="10">
          <el-form-item label="客户英文名">
            <el-input v-model="form.extend_client_english_name"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="10">
          <el-form-item label="是否合作">
            <dictionaryTableSelect
              typeKey="isnohe"
              :fieldValue.sync="customerInfo.c_isnohe"
            ></dictionaryTableSelect>
          </el-form-item>
        </el-col>
      </el-row>

      <!-- //国家省城市 -->
      <el-row>
        <el-col :span="7">
          <el-form-item label="国家">
            <el-select
              v-model="form.state_id"
              placeholder="请选择"
              @change="getprovince(form.state_id)"
            >
              <el-option
                v-for="item in state"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="省份">
            <el-select
              v-model="form.province_id"
              placeholder="请选择"
              @change="getCity(form.province_id)"
            >
              <el-option
                v-for="item in province"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="城市">
            <el-select v-model="form.city_id" placeholder="请选择">
              <el-option
                v-for="item in City"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              >
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="7">
          <el-form-item label="客户类型">
           <dictionaryTableSelect
              typeKey="ketype"
              :fieldValue.sync="customerInfo.c_ketype"
            ></dictionaryTableSelect>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="所属行业">
            <dictionaryTableSelect
              typeKey="hangye"
              :fieldValue.sync="customerInfo.c_hangye"
            ></dictionaryTableSelect>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="分支机构">
            <el-input v-model="form.extenf_embranchment"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="7">
          <el-form-item label="Email">
            <el-input v-model="form.extend_email"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="公司主页">
            <el-input v-model="form.extend_homepage_of_a_company"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="关系建立时间">
            <el-input
              type="date"
              v-model="form.extend_relation_time"
            ></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="7">
          <el-form-item label="关系部门">
            <el-input v-model="form.extend_relation_department"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="信用级别">
             <dictionaryTableSelect
              typeKey="xin"
              :fieldValue.sync="customerInfo.c_xin"
            ></dictionaryTableSelect>
          </el-form-item>
        </el-col>
        <el-col :span="7">
          <el-form-item label="亲密度">
            <dictionaryTableSelect
              typeKey="qin"
              :fieldValue.sync="customerInfo.c_qin"
            ></dictionaryTableSelect>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="10">
          <el-form-item label="开户银行名称">
            <el-input v-model="form.extend_bank_name"></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="10">
          <el-form-item label="企业代码">
            <el-input v-model="form.enterprise_code"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-row>
        <el-col :span="10">
          <el-form-item label="开户银行账号">
            <el-input v-model="form.extend_bank_account"></el-input>
          </el-form-item>
        </el-col>

        <el-col :span="10">
          <el-form-item label="法定代表">
            <el-input v-model="form.extend_legal_published"></el-input>
          </el-form-item>
        </el-col>
      </el-row>

      <el-form-item label="纳税人识别号">
        <el-input v-model="form.extend_taxpayer_registration_number"></el-input>
      </el-form-item>

      <el-form-item label="备注">
        <el-input v-model="form.extend_remark"></el-input>
      </el-form-item>
    </fieldset>

    <p align="left" style="color: black; font-size: 20px">满意度调查</p>
    <el-button @click="showm">添加</el-button>
    <fieldset>
      <el-table :data="manData" style="width: 100%">
        <el-table-column
          prop="satisfaction_survey_number"
          label="序号"
          width="180"
        ></el-table-column>
        <el-table-column
          prop="satisfaction_survey_content"
          label="调查内容"
          width="180"
        ></el-table-column>
        <el-table-column prop="satisfaction_name" label="满意度">
        </el-table-column>
        <el-table-column prop="satisfaction_survey_time" label="调查时间">
        </el-table-column>
        <el-table-column prop="satisfaction_type_name" label="调查方式">
        </el-table-column>
        <el-table-column prop="satisfaction_remark" label="备注">
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button @click="ManCha(scope.row.satisfaction_survey_id)"
              >查看</el-button
            >
            <el-button @click="ManCha(scope.row.satisfaction_survey_id)"
              >编辑</el-button
            >
            <el-button @click="Deleman(scope.row.satisfaction_survey_id)"
              >删除</el-button
            >
          </template> 
        </el-table-column>
      </el-table>
    </fieldset>

    <el-dialog title="添加用户满意度"   :visible.sync="manss" width="30%">
      <span slot="footer" class="dialog-footer">
        <el-form ref="manInfo" :rules="rules" :model="manInfo" label-width="80px">
          <el-form-item label="序号" prop="satisfaction_survey_number" >
            <el-input v-model="manInfo.satisfaction_survey_number" WarningColor='warning'></el-input>
          </el-form-item>
          <el-form-item label="调查内容" prop="satisfaction_survey_content">
            <el-input v-model="manInfo.satisfaction_survey_content" WarningColor='warning'></el-input>
          </el-form-item>
          <el-form-item label="调查时间" prop="satisfaction_survey_time">
            <el-input
              type="date"
              v-model="manInfo.satisfaction_survey_time"
              WarningColor='warning'
            ></el-input>
          </el-form-item>
          <el-form-item label="满意度">
            <dictionaryTableSelect
             v-model="manInfo.satisfaction_id"
              typeKey="man"
              :fieldValue.sync="customerInfo.c_man"
            ></dictionaryTableSelect>
          </el-form-item>
          <el-form-item label="调查原因">
            <el-input v-model="manInfo.satisfaction_cause"></el-input>
          </el-form-item>
          <el-form-item label="调查方式">
            <dictionaryTableSelect
            v-model="manInfo.satisfaction_type_id"
              typeKey="diao"
              :fieldValue.sync="customerInfo.c_diao"
            ></dictionaryTableSelect>
          </el-form-item>
          <el-form-item label="最满意方面">
            <el-input v-model="manInfo.most_satisfying_aspect"></el-input>
          </el-form-item>
          <el-form-item label="最不满意方面">
            <el-input v-model="manInfo.most_usatisfying_aspect"></el-input>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="manInfo.satisfaction_remark"></el-input>
          </el-form-item>
          <el-button type="primary" @click="SatisfactionSurveyPoAdd('manInfo')"
            >确 定</el-button
          >
        </el-form>
      </span>
    </el-dialog>

     <el-dialog title="满意度查看" :visible.sync="fanmanshow" width="30%">
      <span slot="footer" class="dialog-footer">
        <el-form>
          <el-form-item label="序号">
            <el-input
              v-model="FanmanInfo.satisfaction_survey_number"
            ></el-input>
          </el-form-item>
          <el-form-item label="调查内容">
            <el-input
              v-model="FanmanInfo.satisfaction_survey_content"
            ></el-input>
          </el-form-item>
          <el-form-item label="调查时间">
            <el-input
              type="date"
              v-model="FanmanInfo.satisfaction_survey_time"
            ></el-input>
          </el-form-item>
          <el-form-item label="满意度">
            <dictionaryTableSelect
             v-model="manInfo.satisfaction_id"
              typeKey="man"
              :fieldValue.sync="customerInfo.c_man"
            ></dictionaryTableSelect>
          </el-form-item>
          <el-form-item label="调查原因">
            <el-input v-model="manInfo.satisfaction_cause"></el-input>
          </el-form-item>
          <el-form-item label="调查方式">
            <dictionaryTableSelect
            v-model="manInfo.satisfaction_type_id"
              typeKey="diao"
              :fieldValue.sync="customerInfo.c_diao"
            ></dictionaryTableSelect>
          </el-form-item>
          <el-form-item label="最满意方面">
            <el-input v-model="FanmanInfo.most_satisfying_aspect"></el-input>
          </el-form-item>
          <el-form-item label="最不满意方面">
            <el-input v-model="FanmanInfo.most_usatisfying_aspect"></el-input>
          </el-form-item>
          <el-form-item label="备注">
            <el-input v-model="FanmanInfo.satisfaction_remark"></el-input>
          </el-form-item>
          <el-button type="primary" @click="Updateman">修改</el-button>
        </el-form>
      </span>
    </el-dialog>
    <p align="left" style="color: black; font-size: 20px">扩展信息</p>
     <el-form-item label="附件">
            <el-upload
              class="upload-demo"
              :action="uploadUrl"
              multiple
              :on-success="handleAvatarSuccess"
              name="fileList"
              :show-file-list="false"
            >
              <el-button size="small" type="primary">点击上传</el-button>
              <div slot="tip" class="el-upload__tip">
                只能上传jpg/png文件，且不超过500kb
              </div>
            </el-upload>
            <el-table :data="customerInfo.fileList" style="width: 100%">
              <el-table-column prop="fileName" label="文件名" width="180">
              </el-table-column>
              <el-table-column prop="upLoadDate" label="上传时间" width="180">
              </el-table-column>
              <el-table-column prop="fileSize" label="文件大小">
              </el-table-column>
              <el-table-column prop="fileTye" label="文件类型">
              </el-table-column>
             
            </el-table>
          </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="CustomerAdd('form')"
        >立即创建</el-button
      >
      <el-button>取消</el-button>
    </el-form-item>
    </el-form>
    </div>
</template>

<script>
var lujing = "http://localhost:55117/api/Customer/";
export default {
  data() {
    return {
      loginUserName: "",
      
      form: {
        whether_cooperation_id:null,
        client_id:null,
        industry_id:null,
        extend_credit_ratings_id:null,
        extend_intimacy_id:null,
      },
      customerInfo: {
        fileList: [],
        c_type: "2",
        industry: null,
        intimacy:"1",
      },
      fuData:[],
      FirstPartyPo:{
      },
      FanFirstInfo:{},
      FanmanInfo:{},
      tableData:[],
      state:[],
      province:[],
      manData:[],
      manInfo:{
        satisfaction_id:null,
        satisfaction_type_id:null,
      },
      //满意度
      satisfaction:[],
      //调查方式
      survey:[],
      City:[],
      //是否合作
      isno:[],
      //亲密度
      intimate:[],
      //信用级别
      credit:[],
      //所属行业
      industry:[],
      //客户类型
      clienttype:[],
      dialogVisible:false,
      manss:false,
      FirstCha:false,
      fanmanshow:false,

       rules: {
        
        customer_number: [
          { required: true, message: "请输入活动名称", trigger: "blur" },
        ],
        customer_client_name: [
          { required: true, message: "请输入客户名称", trigger: "blur" },
        ],
         customer_company_address: [
          { required: true, message: "请输入公司地址", trigger: "blur" },
        ],
        first_party_number: [
          { required: true, message: "请输入序号", trigger: "blur" },
        ],
        first_party_tell: [
          { required: true, message: "请输入电话", trigger: "blur" },
        ],
        first_party_name: [
          { required: true, message: "请输入姓名", trigger: "blur" },
        ],
        satisfaction_survey_time: [
          { required: true, message: "请选择时间", trigger: "blur" },
        ],
        satisfaction_survey_content: [
          { required: true, message: "请输入调查内容", trigger: "blur" },
        ],
        satisfaction_survey_number: [
          { required: true, message: "请输入序号", trigger: "blur" },
        ],
      },
      uploadUrl:
        process.env.VUE_APP_BASE_API + "FileManager/FileManager/FilesUpload",
      customerInfo: {
        fileList: [],
        c_man: null,
        c_diao:null,
        c_isnohe:null,
        c_ketype:null,
        c_hangye:null,
        c_xin:null,
        c_qin:null,
      },
    };
  },
  components: {
    dictionaryTableSelect: () =>
      import("@/components/system_manager/DictionaryTableSelect"),
  },
  created() {
      this.getState();
      
  },

  methods: {
    handleAvatarSuccess(res, files, fileList) {
      console.log(res);
      if (res.code == 1) {
        res.data.some((f, i) => {
          this.customerInfo.fileList.push({
            fileName: f.fileOldName,
            upLoadDate: f.upLoadDate,
            fileSize: f.fileSize,
            fileTye: f.fileType,
            userName: this.loginUserName,
          });
        });
      }
    },
    onSubmit() {
      console.log("submit!");
    },
     CustomerAdd(form) {
      if(this.tableData.length==0)
      {
        this.$message("请添加甲方负责人信息");
        return;
      }
      this.form.whether_cooperation_id=this.customerInfo.c_isnohe;
      this.form.client_id=this.customerInfo.c_ketype;
      this.form.industry_id=this.customerInfo.c_hangye;
      this.form.extend_credit_ratings_id=this.customerInfo.c_xin;
      this.form.extend_intimacy_id=this.customerInfo.c_qin;
      this.$refs[form].validate((valid) => {
        if (valid) {
          this.$myaxios
            .post(lujing + "CustomerAdd", this.form)
            .then((obj) => {
              if (obj.data != null) {
                this.$message("添加成功");
              }
            });
        } 
      });
    },
     showj() {
      this.dialogVisible = true;
    },
    FirstPartyPoAdd(FirstPartyPo) {
       this.$refs[FirstPartyPo].validate((valid) => {
          if (valid) {
            this.$myaxios
        .post(lujing + "FirstPartyAdd", this.FirstPartyPo)
        .then((obj) => {
          if (obj.data != null) {
            this.$message("添加成功");
            this.dialogVisible = false;
            this.getFirstParty();
          }
        });
          } else {
            console.log('error submit!!');
            return false;
          }
        });
     
    },
    getFirstParty() {
      this.$myaxios.get(lujing + "GetFirstParty").then((obj) => {
        this.tableData = obj.data;
      });
    },
     async getState() {
      this.$myaxios.get(lujing + "GetChina?id=0").then((obj) => {
        this.state = obj.data;
      });
    },
     SatisfactionSurveyPoAdd(manInfo) {
       this.manInfo.satisfaction_id=this.customerInfo.c_man;
       this.manInfo.satisfaction_type_id=this.customerInfo.c_diao
       this.$refs[manInfo].validate((valid) => {
        if (valid) {
         this.$myaxios
        .post(lujing + "SatisfactionSurveyAdd", this.manInfo)
        .then((obj) => {
          if (obj.data > 0) {
            this.$message("添加成功");
            this.manss = false;
            this.getSatisfactionSurvey();
          }
        });
        } 
      });
      
    },
    getSatisfactionSurvey() {
      this.$myaxios.get(lujing + "GetSatisfactionSurveyPos").then((obj) => {
        this.manData = obj.data;
        console.log(obj.data);
      });
    },
    async getprovince(id) {
      this.province = [];
     
      this.$myaxios.get(lujing + "GetChina?id=1").then((obj) => {
        this.province = obj.data;
        console.log(this.province);
      });
    },
    async getCity(id) {
     
       
     
      this.$myaxios.get(lujing + "GetChina?id=" + id).then((obj) => {
        this.City = obj.data;
      });
    },
    showm() {
      this.manss = true;
    },
    //甲方信息反填
     FanFirst(id) {
      this.FirstCha = true;
      this.$myaxios.get(lujing + "FanFirst?id=" + id).then((obj) => {
        this.FanFirstInfo = obj.data;
      });
    },
    //甲方信息修改
    UpdateFirst() {
      this.$myaxios
        .post(lujing + "UpdateFirst", this.FanFirstInfo)
        .then((obj) => {
          if (obj.data != null) {
            this.$message("修改成功");
            this.FirstCha = false;
            this.getFirstParty();
          }
        });
    },
    //甲方信息删除
    DeleFirst(id) {
      if (confirm("确认删除吗？")) {
        this.$myaxios.post(lujing + "DeleFirst?id=" + id).then((obj) => {
          if (obj.data != null) {
            this.$message("删除成功");
            this.tableData = [];
           
          }
        });
      }
    },
    UpdateFirst() {
      this.$myaxios
        .post(lujing + "UpdateFirst", this.FanFirstInfo)
        .then((obj) => {
          if (obj.data != null) {
            this.$message("修改成功");
            this.FirstCha = false;
            this.getFirstParty();
          }
        });
    },
    ManCha(id){
        this.fanmanshow=true;
        this.$myaxios.get(lujing+"ManCha?id="+id).then(obj=>{
            this.FanmanInfo=obj.data;
            this.customerInfo.c_man = this.FanmanInfo.satisfaction_id;
            this.customerInfo.c_diao=this.FanmanInfo.satisfaction_type_id;
            
        })
    },
    Updateman() {
      this.ManCha();
      this.$myaxios.post(lujing + "Updateman", this.FanmanInfo).then((obj) => {
        if (obj.data != null) {
          this.$message("修改成功");
          this.fanmanshow = false;
          this.getSatisfactionSurvey();
        }
      });
    },
     Deleman(id) {
      if (confirm("确认删除吗")) {
        this.$myaxios.post(lujing + "Deleman?id=" + id).then((obj) => {
          if (obj.data != null) {
            this.$message("删除成功");
            this.manData = [];
           
          }
        });
      }
    },
  },
};
</script>

<style >
 
.el-input__inner[DangerColor="danger"] {
  background-color: #F56C6C;    
}
 
.el-input__inner[WarningColor="warning"] {
  background-color: #e9c896;    
}
 
.el-input__inner[SuccessColor="success"] {
  background-color: #67C23A;    
}
 
</style>





 

 
